import 'package:flutter_nb_net/flutter_net.dart';

class AppMenuResp extends BaseNetModel {
  int? code;
  String? msg;
  HomeConfigResp? data;

  AppMenuResp({this.code, this.msg, this.data});

  @override
  fromJson(Map<String, dynamic> json) {
    return AppMenuResp(
      code: json['code'],
      msg: json['msg'],
      data: json['data'] == null ? null : HomeConfigResp().fromJson(json['data']),
    );
  }
}

class HomeConfigResp extends BaseNetModel {
  String? deviceImage;
  List<AppMenuData>? menuList;

  HomeConfigResp({this.deviceImage, this.menuList});

  @override
  fromJson(Map<String, dynamic> json) {
    return HomeConfigResp(
      deviceImage: json['deviceImage'],
      menuList: json['menuList'] == null
          ? null
          : List<AppMenuData>.from(json['menuList'].map((x) => AppMenuData().fromJson(x))),
    );
  }
}

class AppMenuData extends BaseNetModel {
  String? menuName;
  String? menuCode;
  String? path;
  String? iconUrl;
  int? orderNum;
  bool? isTop;

  AppMenuData({this.menuName, this.menuCode, this.path, this.iconUrl, this.orderNum, this.isTop});

  @override
  fromJson(Map<String, dynamic> json) {
    return AppMenuData(
      menuName: json['menuName'],
      menuCode: json['menuCode'],
      path: json['path'],
      iconUrl: json['iconUrl'],
      orderNum: json['orderNum'],
      isTop: json['isTop'],
    );
  }
}
